﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MF.Scanner
{
    public class BarcodeScanner
    {
        public string DeviceName { get; set; }
        public string HardwareID { get; set; }
    }

    public class BarcodeScannerEventArgs : EventArgs
    {
        public string Value { get; set; }
    }

    public class BarcodeScannerInput
    {
        public BarcodeScannerInput()
        {
            InitDevices();
            //hook into external scan event


        }

        protected void HandleExternalScanEvent(object sender, EventArgs args)
        {
            if(BarcodeScanned!=null)
            {
                BarcodeScanned(this, new BarcodeScannerEventArgs());
            }
        }

        private void InitDevices()
        {
            Devices = new List<BarcodeScanner>();
        }

        public List<BarcodeScanner> Devices { get; set; } 

        public static EventHandler<BarcodeScannerEventArgs> BarcodeScanned;
    }
}
